# coding=utf-8
from greenlet import greenlet
import time


def task01():
    while True:
        print("---1---")
        time.sleep(0.2)
        gr2.switch()


def task02():
    while True:
        print("---2---")
        time.sleep(0.2)
        gr1.switch()


gr1 = greenlet(task01)
gr2 = greenlet(task02)
gr1.switch()
